import React, { PureComponent } from "react"
import { bindActionCreators } from "redux"
import { connect } from "react-redux"
import {Menu,Dropdown,Icon,Avatar} from "antd"
import Message from "./message"

import { userLogOut } from "app/user/actions"
@connect(
  ({ user }) => ({ user }),
  (dispatch) => (
    bindActionCreators({
      userLogOut
    }, dispatch)
  )
)
export default class Head extends PureComponent {
  render() {
    return (
      <div className="app-head flex">
          <div className="app-head-logo">
              <Icon type="aliwangwang-o" />
              <span></span>
              <span>公</span><span>安</span><span>绩</span><span>效</span><span>考</span><span>核</span><span>系</span><span>统</span>
          </div>
          <div className="app-head-user flex">
            <Avatar size="large" src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
            <Dropdown overlay={this.userMenu()}>
              <a className="ant-dropdown-link" href="javascript:void 0">
                彭于晏<Icon type="down"/>
              </a>
            </Dropdown>
            <Icon type="cloud-o" />
          </div>
      </div>
    )
  }
  userMenu = () => {
    return (<Menu
      onClick={this.menuClick}>
      <Menu.Item
        key="1">
        修改密码
      </Menu.Item>
      <Menu.Item
        key="2">
        注销
      </Menu.Item>
    </Menu>)
  }
  menuClick = (status) => {
  }
}
